// --------------------------------------------------------------------------------------------------------------------
// <copyright file="PropertyInfoExtensions.cs" company="JDML Consulting Ltd.">
//   Copyright 2011 Photon Project - http://photon.codeplex.com
// </copyright>
// <summary>
//   Defines the PropertyInfoExtensions type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Photon.Reflection
{
    using System;
    using System.Reflection;

    [Obsolete("Do not use, class was hacked in (sigh) to resolve issue in moq and will be removed.")]
    public static class PropertyInfoExtensions
    {
        public static int GetDepthInInheritanceTree(this PropertyInfo property)
        {
            var depth = 0;
            var current = property.DeclaringType;
            while (current.BaseType != null)
            {
                current = current.BaseType;
                depth++;
            }
            return depth;
        }
    }
}